#include<vector>
using namespace std;
class Solution {
public:
    int takeAttendance(vector<int>& records) {
        int n = records.size(), ret = 0;
        for (int i = 0; i < n; i++)
            ret ^= records[i] ^ i;
        ret ^= n;
        return ret;
    }
};